package dao.impl;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import module.User;
import dao.ABSBasicDAO;


public class UserDAOImpl extends ABSBasicDAO<User> {
	
	/**
	 * 构造方法
	 * @param sqlMapClient
	 */
	public UserDAOImpl(SqlMapClient sqlMapClient) {
		super(sqlMapClient);
	}
	
	/* (non-Javadoc)
	 * @see dao.userDAO#updateUser(module.User)
	 */
	public void updateT(User user) throws SQLException {
		sqlMapClient.update("User.updateUserInfo", user);
		
	}

	/* (non-Javadoc)
	 * @see dao.userDAO#insertUser(java.lang.String, module.User)
	 */
	public void insertT(User user) throws SQLException {
		sqlMapClient.insert("User.insertUserInfo", user);
		
	}

	/* (non-Javadoc)
	 * @see dao.userDAO#getAll()
	 */
	public List<User> getAll() throws SQLException {
		// TODO Auto-generated method stub
		return (List<User>)sqlMapClient.queryForList("User.getAll");
	}

	/* (non-Javadoc)
	 * @see dao.userDAO#getById()
	 */
	public User getById(String id) throws SQLException {
		return (User)sqlMapClient.queryForObject("User.getById",id);
	}

	/* (non-Javadoc)
	 * @see dao.userDAO#getByPK()
	 */
	public User getByPK() {
		return null;
	}
}
